Skip to content

Conversation

@Bluefinger
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…lls (elastic#242727)

## Summary

Closes elastic#242716

This PR updates the Trace Errors API calls for APM, and splits the
`getApmTraceError` call from the Unified Trace APIs to have a new
`getUnifiedApmTraceError` call, which allows to unify the return
response for the Unified Trace APIs, while maintaining backwards
compatibility with the old APM APIs. Both Error methods now make use of
`accessKnownApmEventFields`, with `getApmTraceError` better handling the
unflattening and response construction, and `getUnifiedApmTraceError`
querying for less fields and avoiding the use of unflattening entirely.
This now has the Unified Trace APIs no longer using any unflattening in
their call stack, and standardises the error interface between APM and
OTEL errors.

## How to test

- Go to Discover on an Observability space, select a traces index (APM
and/or OTEL) in either Classic or ES|QL.
- Select a trace with either an `event.outcome` as `failure` or
`status.code` as `Error`. On spans/transactions with an error attached
to it, it should show on both the focused and full trace waterfall
without any issue.
- Going through to the APM page via the `trace.id` link, the APM trace
waterfall should also show the same errors with no issue.

(cherry picked from commit 505fe7b)

# Conflicts:
#	x-pack/solutions/observability/plugins/apm/server/routes/traces/get_trace_items.ts
#	x-pack/solutions/observability/plugins/apm/server/routes/traces/get_unified_trace_errors.ts
#	x-pack/solutions/observability/plugins/apm/server/routes/traces/get_unified_trace_items.test.ts
#	x-pack/solutions/observability/plugins/apm/server/routes/traces/get_unified_trace_items.ts
#	x-pack/solutions/observability/plugins/apm/server/routes/traces/normalize_errors.test.ts
#	x-pack/solutions/observability/plugins/apm/server/routes/traces/normalize_errors.ts
@Bluefinger Bluefinger added the backport This PR is a backport of another PR label Nov 21, 2025
@Bluefinger Bluefinger enabled auto-merge (squash) November 21, 2025 16:52
@botelastic botelastic bot added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Nov 21, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@Bluefinger
Copy link
Contributor Author

Bluefinger commented Nov 21, 2025

Please do not approve this without testing. These were some very painful merge conflicts.

I've verified that the changes where the merge conflicts were the most painful do not affect the public API.

@Bluefinger Bluefinger disabled auto-merge November 21, 2025 16:56
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.7MB 3.7MB +129.0B

History

@Bluefinger Bluefinger closed this Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants